<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>题库 - CodeSphere OJ</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4361ee;
            --secondary: #3f37c9;
            --accent: #4895ef;
            --light: #f8f9fa;
            --dark: #212529;
            --success: #4cc9f0;
            --danger: #f72585;
            --warning: #f8961e;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        body {
            background-color: var(--light);
            color: var(--dark);
            line-height: 1.6;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }
        
        /* 导航栏 */
        nav {
            background-color: white;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            padding: 20px 0;
            position: sticky;
            top: 0;
            z-index: 100;
        }
        
        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .logo {
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--primary);
            text-decoration: none;
            display: flex;
            align-items: center;
        }
        
        .logo i {
            margin-right: 10px;
            color: var(--accent);
        }
        
        .nav-links {
            display: flex;
            gap: 30px;
        }
        
        .nav-links a {
            color: var(--dark);
            text-decoration: none;
            font-weight: 500;
            transition: color 0.3s;
        }
        
        .nav-links a:hover {
            color: var(--primary);
        }
        
        /* 题目列表区域 */
        .problems-section {
            padding: 60px 0;
        }
        
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
        }
        
        .section-title h2 {
            font-size: 2rem;
            color: var(--dark);
        }
        
        .search-filter {
            display: flex;
            gap: 15px;
        }
        
        .search-box {
            padding: 10px 15px;
            border: 1px solid #ddd;
            border-radius: 5px;
            width: 250px;
        }
        
        .filter-select {
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            background-color: white;
        }
        
        .problems-table {
            width: 100%;
            border-collapse: collapse;
            background-color: white;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        }
        
        .problems-table thead {
            background-color: var(--primary);
            color: white;
        }
        
        .problems-table th {
            padding: 15px 20px;
            text-align: left;
            font-weight: 600;
        }
        
        .problems-table td {
            padding: 15px 20px;
            border-bottom: 1px solid #eee;
        }
        
        .problems-table tr:last-child td {
            border-bottom: none;
        }
        
        .problems-table tbody tr:hover {
            background-color: rgba(67, 97, 238, 0.03);
        }
        
        .problem-id {
            width: 10%;
            font-weight: 500;
            color: #666;
        }
        
        .problem-title {
            width: 70%;
        }
        
        .problem-title a {
            color: var(--dark);
            text-decoration: none;
            transition: color 0.3s;
            font-weight: 500;
        }
        
        .problem-title a:hover {
            color: var(--primary);
        }
        
        .problem-difficulty {
            width: 20%;
        }
        
        .difficulty-easy {
            color: var(--success);
            font-weight: 600;
        }
        
        .difficulty-medium {
            color: var(--warning);
            font-weight: 600;
        }
        
        .difficulty-hard {
            color: var(--danger);
            font-weight: 600;
        }
        
        .pagination {
            display: flex;
            justify-content: center;
            margin-top: 40px;
            gap: 10px;
        }
        
        .page-btn {
            padding: 8px 15px;
            border: 1px solid #ddd;
            background-color: white;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .page-btn:hover {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        .page-btn.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 页脚 */
        footer {
            background-color: var(--dark);
            color: white;
            padding: 50px 0 20px;
            text-align: center;
        }
        
        .footer-content {
            margin-bottom: 30px;
        }
        
        .footer-links {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-bottom: 30px;
        }
        
        .footer-links a {
            color: white;
            text-decoration: none;
            transition: color 0.3s;
        }
        
        .footer-links a:hover {
            color: var(--accent);
        }
        
        .copyright {
            color: rgba(255,255,255,0.7);
            font-size: 0.9rem;
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav>
        <div class="container navbar">
            <a href="index.html" class="logo">
                <i class="fas fa-code"></i>
                CodeSphere
            </a>
            <div class="nav-links">
                <a href="index.html">首页</a>
                <a href="all_questions" class="active">题库</a>
                <a href="#">竞赛</a>
                <a href="#">讨论</a>
                <a href="#">关于</a>
            </div>
        </div>
    </nav>

    <!-- 题目列表区域 -->
    <section class="problems-section">
        <div class="container">
            <div class="section-header">
                <div class="section-title">
                    <h2>题库</h2>
                </div>
                <div class="search-filter">
                    <input type="text" class="search-box" placeholder="搜索题目...">
                    <select class="filter-select">
                        <option value="all">所有难度</option>
                        <option value="easy">简单</option>
                        <option value="medium">中等</option>
                        <option value="hard">困难</option>
                    </select>
                </div>
            </div>
            
            <table class="problems-table">
                <thead>
                    <tr>
                        <th>题目编号</th>
                        <th>题目标题</th>
                        <th>题目难度</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- 这里将使用ctemplate动态生成题目列表 -->
                    {{#PROBLEMS}}
                    <tr>
                        <td class="problem-id">{{id}}</td>
                        <td class="problem-title"><a href="question/{{id}}">{{title}}</a></td>
                        <td class="problem-difficulty difficulty-{{difficulty}}">{{difficulty_text}}</td>
                    </tr>
                    {{/PROBLEMS}}
                    <!-- 动态生成结束 -->
                </tbody>
            </table>
            
            <div class="pagination">
                <button class="page-btn"><i class="fas fa-chevron-left"></i></button>
                <button class="page-btn active">1</button>
                <button class="page-btn">2</button>
                <button class="page-btn">3</button>
                <button class="page-btn"><i class="fas fa-chevron-right"></i></button>
            </div>
        </div>
    </section>

    <!-- 页脚 -->
    <footer>
        <div class="container">
            <div class="footer-content">
                <a href="index.html" class="logo" style="color: white; margin-bottom: 20px; display: inline-block;">
                    <i class="fas fa-code"></i>
                    CodeSphere
                </a>
                <p>让编程学习变得更简单、更高效</p>
            </div>
            <div class="footer-links">
                <a href="index.html">首页</a>
                <a href="#">题库</a>
                <a href="#">竞赛</a>
                <a href="#">讨论</a>
                <a href="#">关于我们</a>
                <a href="#">帮助中心</a>
            </div>
            <div class="copyright">
                &copy; 2023 CodeSphere OJ. All rights reserved.
            </div>
        </div>
    </footer>
</body>
</html>